package org.example.repository;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
@Accessors(fluent = true)
public class Query {

    public static final Query Empty = new Query();

    private static final int DEFAULT_LIMIT = 1000;

    private List<String> select;
    private Condition where;
    private String orderBy;
    private Integer limit = DEFAULT_LIMIT;
    private Integer offset;

    public Query() {
    }

    public Query(Query query) {
        this.select = new ArrayList<>(query.select);
        this.where = query.where;
        this.orderBy = query.orderBy;
        this.limit = query.limit;
        this.offset = query.offset;
    }
}
